package com.tiles.tools;

import com.alibaba.fastjson.JSON;
import redis.clients.jedis.Jedis;

import java.util.List;

public class RedisClientSingle {



    public  void set(String key,String value) {
        Jedis jedis = new Jedis();
       String string= jedis.set(key, value);
        jedis.close();

    }

    public     String get(String key) {
        Jedis jedis = new Jedis();
        String string = jedis.get(key);
        jedis.close();
        return string;
    }

    public void lpush(String key,String lists){
        Jedis jedis = new Jedis();

        jedis.lpush(key, lists);
    }

    public String rpopLpush(String key) {
        Jedis jedis = new Jedis();
      String jsonString =jedis.rpoplpush(key, key);

      return jsonString;
    }
}
